/**
 * 地址簿相关API
 */

import request from './index.js'

// 地址簿相关API
export const addressApi = {
  // 获取地址列表
  getAddressList() {
    return request.get('/api/v1/sales/address/list')
  },
  
  // 添加地址
  addAddress(data) {
    return request.post('/api/v1/sales/address/add', data)
  },
  
  // 更新地址
  updateAddress(data) {
    return request.put('/api/v1/sales/address/update', data)
  },
  
  // 删除地址
  deleteAddress(id) {
    return request.delete(`/api/v1/sales/address/delete/${id}`)
  },
  
  // 设置默认地址
  setDefaultAddress(id) {
    return request.put(`/api/v1/sales/address/setDefault/${id}`)
  }
}

export default addressApi 